#include <iostream>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>

int main(int argc, char* argv[] )
{
    //./mykill signal pid

    if(argc!= 3)
    {
        std::cout << "error input num " << std::endl;
        return 1;
    }

    int signal = std::stoi(argv[1]);
    pid_t  pid = std::stoi(argv[2]);

    int n = kill(pid, signal);
    if(n == 0)
    {
        std::cout << "kill success" << " ,target_pid: " << pid << " ,signal: " << signal << std::endl;
    }
    else
    {
        std::cout << "kill fail" <<std::endl;
    }
    
}